<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">编辑设备详细信息</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="deviceInformationForm" method="post">
                        <input type="hidden" id="id" name="id" th:value="${record.id}"/>
                        <!--设备品牌(deviecBrand)-->
                        <div class="am-form-group">
                            <label for="deviecBrand" class="am-u-sm-2 am-form-label">设备品牌
                                <span class="tpl-form-line-small-title">DeviecBrand</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="deviecBrand" class="tpl-form-input" placeholder="请输入"
                                       name="deviecBrand"
                                       th:value="${record.deviecBrand != null} ? ${record.deviecBrand} : ''"/>
                            </div>
                        </div>
                        <!--机械类型(machineryType)-->
                        <div class="am-form-group">
                            <label for="machineryType" class="am-u-sm-2 am-form-label">机械类型
                                <span class="tpl-form-line-small-title">MachineryType</span>
                            </label>
                            <div class="am-u-sm-10">
                                <select class="tpl-form-input" name="machineryType" id="machineryType">
                                    <option value=''>---请选择---</option>
                                    <option value="0"
                                            th:selected="${record.machineryType != null and record.machineryType == '0'}">
                                        挖掘机
                                    </option>
                                    <option value="1"
                                            th:selected="${record.machineryType != null and record.machineryType == '1'}">
                                        装载机
                                    </option>
                                    <option value="2"
                                            th:selected="${record.machineryType != null and record.machineryType == '2'}">
                                        矿用自卸车
                                    </option>
                                    <option value="3"
                                            th:selected="${record.machineryType != null and record.machineryType == '3'}">
                                        推土机
                                    </option>
                                    <option value="4"
                                            th:selected="${record.machineryType != null and record.machineryType == '4'}">
                                        压路机
                                    </option>
                                    <option value="5"
                                            th:selected="${record.machineryType != null and record.machineryType == '5'}">
                                        平地机
                                    </option>
                                    <option value="6"
                                            th:selected="${record.machineryType != null and record.machineryType == '6'}">
                                        混凝土机械
                                    </option>
                                    <option value="7"
                                            th:selected="${record.machineryType != null and record.machineryType == '7'}">
                                        桩工机械
                                    </option>
                                    <option value="8"
                                            th:selected="${record.machineryType != null and record.machineryType == '8'}">
                                        凿岩机械
                                    </option>
                                    <option value="9"
                                            th:selected="${record.machineryType != null and record.machineryType == '9'}">
                                        摊铺机
                                    </option>
                                    <option value="10"
                                            th:selected="${record.machineryType != null and record.machineryType == '10'}">
                                        俩头忙
                                    </option>
                                    <option value="11"
                                            th:selected="${record.machineryType != null and record.machineryType == '11'}">
                                        旋挖钻
                                    </option>
                                    <option value="12"
                                            th:selected="${record.machineryType != null and record.machineryType == '12'}">
                                        叉车
                                    </option>
                                    <option value="13"
                                            th:selected="${record.machineryType != null and record.machineryType == '13'}">
                                        塔式起重机
                                    </option>
                                </select>
                            </div>
                        </div>
                        <!--设备型号(plateSubject)-->
                        <div class="am-form-group">
                            <label for="plateSubject" class="am-u-sm-2 am-form-label">设备型号
                                <span class="tpl-form-line-small-title">PlateSubject</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="plateSubject" class="tpl-form-input" placeholder="请输入"
                                       name="plateSubject"
                                       th:value="${record.plateSubject != null} ? ${record.plateSubject} : ''"/>
                            </div>
                        </div>
                        <!--发动机型号(engineSubject)-->
                        <div class="am-form-group">
                            <label for="engineSubject" class="am-u-sm-2 am-form-label">发动机型号
                                <span class="tpl-form-line-small-title">EngineSubject</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="engineSubject" class="tpl-form-input" placeholder="请输入"
                                       name="engineSubject"
                                       th:value="${record.engineSubject != null} ? ${record.engineSubject} : ''"/>
                            </div>
                        </div>
                        <!--功率(power)-->
                        <div class="am-form-group">
                            <label for="power" class="am-u-sm-2 am-form-label">功率（kw）
                                <span class="tpl-form-line-small-title">Power</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="power" class="tpl-form-input" placeholder="请输入" name="power"
                                       th:value="${record.power != null} ? ${record.power} : ''"/>
                            </div>
                        </div>
                        <!--发动机编号(enginePlateNum)-->
                        <div class="am-form-group">
                            <label for="enginePlateNum" class="am-u-sm-2 am-form-label">发动机编号
                                <span class="tpl-form-line-small-title">EnginePlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="enginePlateNum" class="tpl-form-input" placeholder="请输入"
                                       name="enginePlateNum"
                                       th:value="${record.enginePlateNum != null} ? ${record.enginePlateNum} : ''"/>
                            </div>
                        </div>
                        <!--厂商类型(productionType)-->
                        <div class="am-form-group">
                            <label for="productionType" class="am-u-sm-2 am-form-label">厂商类型
                                <span class="tpl-form-line-small-title">ProductionType</span>
                            </label>
                            <div class="am-u-sm-10">
                                <div class="am-form-group" id="productionType">
                                    <input type="radio" class="am-form-group" name="productionType" value="0"
                                           th:checked="${record.productionType != null and record.productionType == '0'}">国产</input>
                                    <input type="radio" class="am-form-group" name="productionType" value="1"
                                           th:checked="${record.productionType != null and record.productionType == '1'}">合资</input>
                                    <input type="radio" class="am-form-group" name="productionType" value="2"
                                           th:checked="${record.productionType != null and record.productionType == '2'}">进口</input>
                                </div>
                            </div>
                        </div>
                        <!--行走方式(maneuver)-->
                        <div class="am-form-group">
                            <label for="maneuver" class="am-u-sm-2 am-form-label">行走方式
                                <span class="tpl-form-line-small-title">Maneuver</span>
                            </label>
                            <div class="am-u-sm-10">
                            <div class="am-form-group" id="maneuver">
                                <input type="radio" class="am-form-group" name="maneuver" value="0"
                                       th:checked="${record.maneuver != null and record.maneuver == '0'}">轮式</input>
                                <input type="radio" class="am-form-group" name="maneuver" value="1"
                                       th:checked="${record.maneuver != null and record.maneuver == '1'}">履带</input>
                            </div>
                        </div>
                        </div>
                        <!--设备产地(productionAddress)-->
                        <div class="am-form-group">
                            <label for="productionAddress" class="am-u-sm-2 am-form-label">设备产地
                                <span class="tpl-form-line-small-title">ProductionAddress</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="productionAddress" class="tpl-form-input" placeholder="请输入"
                                       name="productionAddress"
                                       th:value="${record.productionAddress != null} ? ${record.productionAddress} : ''"/>
                            </div>
                        </div>
                        <!--出厂日期(dateOfProduction)-->
                        <div class="am-form-group">
                            <label for="dateOfProduction" class="am-u-sm-2 am-form-label">出厂日期
                                <span class="tpl-form-line-small-title">DateOfProduction</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="dateOfProduction" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="dateOfProduction"
                                       placeholder="请选择日期"
                                       th:value="${#dates.format(record.dateOfProduction, 'yyyy-MM-dd')}"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <!--购买时间(resBuyDate)-->
                        <div class="am-form-group">
                            <label for="resBuyDate" class="am-u-sm-2 am-form-label">购买时间
                                <span class="tpl-form-line-small-title">ResBuyDate</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="resBuyDate" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="resBuyDate"
                                       placeholder="请选择日期"
                                       th:value="${#dates.format(record.resBuyDate, 'yyyy-MM-dd')}"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <!--工作时长(workTime)-->
                        <div class="am-form-group">
                            <label for="workTime" class="am-u-sm-2 am-form-label">工作时长
                                <span class="tpl-form-line-small-title">WorkTime</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="workTime" class="tpl-form-input" placeholder="请输入"
                                       name="workTime" th:value="${record.workTime != null} ? ${record.workTime} : ''"/>
                            </div>
                        </div>
                        <!--燃料类型(fuel)-->
                        <div class="am-form-group">
                            <label for="fuel" class="am-u-sm-2 am-form-label">燃料类型
                                <span class="tpl-form-line-small-title">Fuel</span>
                            </label>
                            <div class="am-u-sm-10">
                                <div class="am-form-group" id="fuel">
                                    <input type="radio" class="am-form-group" name="fuel" value="0"
                                           th:checked="${record.fuel != null and record.fuel == '0'}">柴油</input>
                                    <input type="radio" class="am-form-group" name="fuel" value="1"
                                           th:checked="${record.fuel != null and record.fuel == '1'}">汽油</input>
                                    <input type="radio" class="am-form-group" name="fuel" value="2"
                                           th:checked="${record.fuel != null and record.fuel == '2'}">天然气</input>
                                </div>
                            </div>
                        </div>
                        <!--尾气排放值(outputVolume)-->
                        <div class="am-form-group">
                            <label for="outputVolume" class="am-u-sm-2 am-form-label">尾气排放值
                                <span class="tpl-form-line-small-title">OutputVolume</span>
                            </label>
                            <div class="am-u-sm-10">
                                <div class="am-form-group" id="outputVolume">
                                    <input type="radio" class="am-form-group" name="outputVolume" value="0"
                                           th:checked="${record.fuel != null and record.outputVolume == '0'}">未检测</input>
                                    <input type="radio" class="am-form-group" name="outputVolume" value="1"
                                           th:checked="${record.fuel != null and record.outputVolume == '1'}">已检测</input>
                                </div>
                            </div>
                        </div>
                        <!--出厂编号(factoryNum)-->
                        <div class="am-form-group">
                            <label for="factoryNum" class="am-u-sm-2 am-form-label">出厂编号
                                <span class="tpl-form-line-small-title">FactoryNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="factoryNum" class="tpl-form-input" placeholder="请输入"
                                       name="factoryNum"
                                       th:value="${record.factoryNum != null} ? ${record.factoryNum} : ''"/>
                            </div>
                        </div>
                        <!--设备牌编号(plateNum)-->
                        <div class="am-form-group">
                            <label for="plateNum" class="am-u-sm-2 am-form-label">设备牌编号
                                <span class="tpl-form-line-small-title">PlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="plateNum" class="tpl-form-input" placeholder="请输入"
                                       name="plateNum" th:value="${record.plateNum != null} ? ${record.plateNum} : ''"/>
                            </div>
                        </div>
                        <!--设备所有人(deviceRegisterName)-->
                        <div class="am-form-group">
                            <label for="deviceRegisterName" class="am-u-sm-2 am-form-label">设备所有人
                                <span class="tpl-form-line-small-title">deviceRegisterName</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="deviceRegisterName" class="tpl-form-input" placeholder="请输入"
                                       name="deviceRegisterName"
                                       th:value="${record.deviceRegisterName != null} ? ${record.deviceRegisterName} : ''"/>
                            </div>
                        </div>
                        <!--归属人身份证号(identification)-->
                        <div class="am-form-group">
                            <label for="identification" class="am-u-sm-2 am-form-label">归属人身份证号
                                <span class="tpl-form-line-small-title">identification</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="identification" class="tpl-form-input" placeholder="请输入"
                                       name="identification"
                                       th:value="${record.identification != null} ? ${record.identification} : ''"/>
                            </div>
                        </div>

                        <!--创建日期(createDate)-->
                        <div class="am-form-group">
                            <label for="createDate" class="am-u-sm-2 am-form-label">创建日期
                                <span class="tpl-form-line-small-title">createDate</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="createDate" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="createDate"
                                       placeholder="请选择日期"
                                       th:value="${#dates.format(record.createDate, 'yyyy-MM-dd')}"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
<!--

                        &lt;!&ndash;审核人员(user)&ndash;&gt;
                        <div class="am-form-group">
                            <label for="user" class="am-u-sm-2 am-form-label">审核人员
                                <span class="tpl-form-line-small-title">user</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="user" class="tpl-form-input" placeholder="请输入"
                                       name="user"
                                       th:value="${record.user != null} ? ${record.user} : ''"/>
                            </div>
                        </div>
-->

                        <!--抵押状态(mortgage)-->
                        <div class="am-form-group">
                            <label for="mortgage" class="am-u-sm-2 am-form-label">抵押状态
                                <span class="tpl-form-line-small-title">mortgage</span>
                            </label>
                            <div class="am-u-sm-10">
                                <div class="am-form-group" id="mortgage">
                                    <input type="radio" class="am-form-group" name="mortgage" value="0"
                                           th:checked="${record.mortgage != null and record.mortgage == '0'}">未抵押</input>
                                    <input type="radio" class="am-form-group" name="mortgage" value="1"
                                           th:checked="${record.mortgage != null and record.mortgage == '1'}">已抵押</input>
                                </div>
                            </div>
                        </div>

                       <!-- &lt;!&ndash;设备照片(referenceDeviceImg)&ndash;&gt;
                        <div class="am-form-group">
                            <label for="referenceDeviceImg" class="am-u-sm-2 am-form-label">设备照片
                                <span class="tpl-form-line-small-title">referenceDeviceImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileOne" type="file"/>
                                <input id="referenceDeviceImg" type="hidden" name="referenceDeviceImg"/>
                            </div>
                        </div>

                        &lt;!&ndash;申请人身份证照片或公司营业执照照片(referenceUserImg)&ndash;&gt;
                        <div class="am-form-group">
                            <label for="referenceUserImg" class="am-u-sm-2 am-form-label">申请人身份证照片或公司营业执照照片,发票照
                                <span class="tpl-form-line-small-title">referenceUserImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileTwo" type="file"/>
                                <input id="referenceUserImg" type="hidden" name="referenceUserImg"/>
                            </div>
                        </div>

                        &lt;!&ndash;卖方备案发票信息照片合同照(referenceInvoiceImg)&ndash;&gt;
                        <div class="am-form-group">
                            <label for="referenceInvoiceImg" class="am-u-sm-2 am-form-label">卖方备案发票信息照片,合同照
                                <span class="tpl-form-line-small-title">referenceInvoiceImg</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input id="upFileThree" type="file"/>
                                <input id="referenceInvoiceImg" type="hidden" name="referenceInvoiceImg"/>
                            </div>
                        </div>-->

                        <!--操作-->
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('deviceInformation/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();

    function validateUserForm() {
        valdater = $('#deviceInformationForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写标题"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('deviceInformationForm', 'deviceInformation/saveEdit', 'deviceInformation/listUI');
            return true;
        }
        return false;
    }

   /* initUpFileTwo('upFileOne','referenceDeviceImg','添加设备照片','');
    initUpFileThree('upFileTwo','referenceUserImg','申请人身份证照片或公司营业执照照片,发票照','');
    initUpFileFour('upFileThree','referenceInvoiceImg','卖方备案发票信息照片,合同照','');*/

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>